<?php
/**
 * @package WordPress
 * @subpackage Shining_Glow
 */

get_header(); ?>
<?php
global $mytheme;
query_posts('category_name='.$mytheme->option['featuredCat'].'&showposts='.$mytheme->option['featuredNum'].'');  
$ids = array();
while (have_posts()) : the_post();  
$ids[] = get_the_ID();
endwhile; ?>
<?php
$limit = get_option('posts_per_page');
query_posts(array(
'showposts' => $limit,
'paged' => $paged,
'post__not_in' => $ids,
));
?>
<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>

		<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
            <h2 class="headline"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
            <h4 class="date"><?php the_time('d'); ?>&nbsp;<?php the_time('M'); ?></h4>
            <h4 class="commentnum"><?php comments_popup_link('0', '1', '%'); ?></h4>
            <h4 class="more"><a  href="<?php the_permalink() ?>" title="Read More">Read More</a></h4>
            <div class="entry clearfix">
			<?php 
			global $mytheme;
			$image = get_post_meta($post->ID, $mytheme->option['imageThumb'], true); 
			?>
			<?php if ($image !="") : ?>
			<a class="postImage" href="<?php the_permalink() ?>"><img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" /></a>
			<?php endif; ?>
			<?php the_content_rss('', TRUE, '', 100); ?>
            </div>
            </div>

		<?php endwhile; ?>

		<?php
		include('includes/wp-pagenavi.php');
		if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
		?>

	<?php else : ?>

		<h2 class="center">Not Found</h2>
		<p class="center">Sorry, but you are looking for something that isn't here.</p>
		<?php get_search_form(); ?>

	<?php endif; ?>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
